﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace OpenSelectedPivot
{
    public partial class PivotPage : PhoneApplicationPage
    {
        public enum PivotDef
        {
            One,
            Two,
            Three,
            Four,
        }

        public static PivotDef SelectedPivot;

        public PivotPage()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            switch (SelectedPivot)
            {
                case PivotDef.One:
                    this.pvtControl.SelectedItem = this.pvt1;
                    break;

                case PivotDef.Two:
                    this.pvtControl.SelectedItem = this.pvt2;
                    break;

                case PivotDef.Three:
                    this.pvtControl.SelectedItem = this.pvt3;
                    break;

                case PivotDef.Four:
                    this.pvtControl.SelectedItem = this.pvt4;
                    break;
            }

            base.OnNavigatedTo(e);
        }
    }
}